import { Component, OnInit } from '@angular/core';
import {UserLoginService} from '../services/user-login.service';
import {Router} from '@angular/router';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css'],
  providers: [UserLoginService]
})
export class LoginComponent implements OnInit {

  userName: String;
  password: String;


  constructor(private userLoginService: UserLoginService, private router: Router) { }

  ngOnInit() {
  }


  public login(): void {
    this.userLoginService.login(this.userName, this.password);
    this.router.navigateByUrl("mainPanel");
  }

}
